package com.rany.day07.demo05;

import java.util.ArrayList;
import java.util.Collections;

public class PokerTest {
    public static void main(String[] args) {
        //设置纸牌
        ArrayList<java.lang.String> poker = new ArrayList<>();
        //定义两个数组，存储底色和扑克牌序号
        String[] colors = {"♠","♥","♣","♦"};
        String[] numbers = {"A","2","3","4","5","6","7","8","9","10","J","Q","K"};
        poker.add("大王");
        poker.add("小王");
        for (String color : colors) {
            for (String number : numbers) {
                poker.add(color+number);
            }
        }
        //洗牌
        Collections.shuffle(poker);
        //发牌 定义四个玩家
        ArrayList<String> player1 = new ArrayList<>();
        ArrayList<String> player2 = new ArrayList<>();
        ArrayList<String> player3 = new ArrayList<>();
        ArrayList<String> dipai = new ArrayList<>();
        for (int i = 0; i < poker.size(); i++) {
            String p = poker.get(i);
            if (i>51){
                dipai.add(p);
            }else if (i%3==0){
                player1.add(p);
            }else if (i%3==1){
                player2.add(p);
            }else if (i%3==2) {
                player3.add(p);
            }
        }
        //看牌
        System.out.println(player1);
        System.out.println(player2);
        System.out.println(player3);
        System.out.println(dipai);
    }
}
